//
//  VideoInfo.m
//  AVPlayerDemo
//
//  Created by YIDAOMAC on 2024/1/17.
//

#import "VideoInfo.h"

@implementation VideoInfo

+ (instancetype)infoWithDictionary:(NSDictionary *)dic
{
    VideoInfo *info = [VideoInfo new];
    
    NSDictionary *video = dic[@"video"];
    NSDictionary *cover = video[@"cover"];
    NSArray *list = cover[@"url_list"];
    info.imageURL = [NSURL URLWithString:list.firstObject];
    
    NSArray *download_url = video[@"download_url"];
    info.videoURL = [NSURL URLWithString:download_url.firstObject];
    info.desc = dic[@"description"];
    
    return info;
}

@end
